<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                template="/templates/template.xhtml">
    <ui:define name="title">大额合作方管理</ui:define>
    <ui:define name="content">
        <h:form>
            <p:defaultCommand target="search"/>
            <div class="topbar clearfix" style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="right">
                        <p:commandButton id="search" value="查询" icon="fa fa-search"
                                         update="@form"/>
                        <p:commandButton value="重置" icon="fa fa-refresh" update="@form"
                                         actionListener="#{loanLargeAmountNewPartnerInfoListBean.onRest()}"/>
                        <p:commandButton value="增加" icon="fa fa-plus"
                                         action="#{loanLargeAmountNewPartnerInfoListBean.toAdd()}"/>
                    </f:facet>
                </p:toolbar>
            </div>

            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g">
                    <div class="ui-g-12">
                        <div class="ui-g-12 card">
                            <h1>查询条件</h1>
                            <div class="ui-g-1">
                                <p:outputLabel value="用户名"/>
                            </div>
                            <div class="ui-g-3">
                                <p:inputText value="${loanLargeAmountNewPartnerInfoListBean.$.account}"/>
                            </div>

                            <div class="ui-g-1">
                                <p:outputLabel value="大额渠道"/>
                            </div>
                            <div class="ui-g-3">
                                <p:selectOneMenu value="#{loanLargeAmountNewPartnerInfoListBean.$.channel}" label="channels"
                                                      filter="true" filterMatchMode="contains">
                                    <f:selectItem itemLabel="请选择" itemValue=""/>
                                    <f:selectItems value="#{loanLargeAmountNewPartnerInfoListBean.channelNdInfos}"
                                                   var="channel"
                                                   itemLabel="#{channel}"
                                                   itemValue="#{channel}"/>
                                </p:selectOneMenu>
                            </div>
                        </div>
                        <div class="card">
                            <p:dataTable id="channelNdTable"
                                         style="width: 100%;text-align:center"
                                         var="channelNd"
                                         value="#{loanLargeAmountNewPartnerInfoListBean.lazyDataModel}"
                                         rows="#{constants:get('ROWS')}"
                                         lazy="true"
                                         paginator="true"
                                         paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                                         rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                                         emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                                         scrollable="true"
                                         reflow="true"
                                         resizableColumns="true">
                                <p:column headerText="操作">
                                    <p:splitButton icon="fa fa-eye"
                                        action="#{loanLargeAmountNewPartnerInfoListBean.toEdit(channelNd.id)}" process="@this">
                                        <p:menuitem value="删除" icon="fa fa-times"
                                                    actionListener="#{loanLargeAmountNewPartnerInfoListBean.onDelete(channelNd.id)}"
                                                    process="@this" update="@form">
                                            <p:confirm header="信息提示" message="确定删除么？" icon="ui-icon-alert" width="10%"/>
                                        </p:menuitem>
                                    </p:splitButton>
                                </p:column>

                                <p:column headerText="合作方账户">
                                    <h:outputText value="#{channelNd.account}"/>
                                </p:column>
                                <p:column headerText="关联的大额渠道">
                                    <h:outputText value="#{channelNd.channelNdInfo}"/>
                                </p:column>
                            </p:dataTable>
                        </div>
                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
